<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <title>Merlion Ltd</title>
    </h:head>
    <f:view beforePhase="#{UserDisplayManagedBean.doDisplay}">
        <f:view beforePhase="#{UserManagedBean.initView}">
            <h:body>
                <h:form>
                    
                    <!-- IDLE DIALOG for -->
                    <p:confirmDialog message="You have been idle for 5 minutes. Do you want to continue?"  
                                     showEffect="bounce" hideEffect="explode"  
                                     header="Warning message" severity="alert" widgetVar="confirmation">  
                        <p:commandButton value="Yes" onclick="confirmation.hide()" type="button" /> 
                        <p:commandButton value="No" update="panel" oncomplete="confirmation.hide()"  
                                         actionListener="#{UserManagedBean.doLogout}" /> 
                    </p:confirmDialog>

                    <p:idleMonitor timeout="300000" onidle="confirmation.show()" />  
                    <!--END OF IDLE DIALOG-->

                    <div id="top">
                        <h:graphicImage url="/image/newHeader.jpg"/> 
                    </div>

                    <div id="content">
                        <table>
                            <tr>
                                <td>
                                    <p:toolbar style="height:35px;font-size:80%;">
                                        <p:toolbarGroup align="right">
                                            <p:button title="Home" image="ui-icon-home" outcome="AdminDeptWorkspace"/>
                                            <p:button title="Notes" image="ui-icon-note"/>
                                            <p:button title="Mail" outcome="messages" image="ui-icon-mail-closed"/>     
                                            <p:button title="Edit Preferences" image="ui-icon-gear"/>
                                            <p:button title="Help" image="ui-icon-help"/>
                                            <p:commandButton immediate="true" type="submit" image="ui-icon-close" actionListener="#{UserManagedBean.doLogout}"/> 
                                        </p:toolbarGroup>
                                    </p:toolbar>
                                    <p:menu style="width:200px; height:300px; font-family: Tahoma;border-style: double;">  
                                        <p:submenu label="Main Menu">  
                                            <p:menuitem value="Home" url="http://localhost:8080/MerlionERP-war/userManagement/index.xhtml" ajax="false" icon="ui-icon ui-icon-home"/>  
                                        </p:submenu>  
                                    </p:menu>
                                    <p:calendar mode="inline" style="font-size:11px;font-family:Tahoma"/>

                                </td>
                                <td>
                                    <h:graphicImage value="email.jpeg" style="width:35px;height:35px" />
                                    <h:outputText value="         "/>
                                    <h:outputText value="Send Email Activation"  style="font-family:Tahoma;font-size:20px;font-weight:bolder"/>
                                    <p:spacer width="100" height="10"/>

                                    <p:panel id="panel" style=" font-family: Tahoma;width:1122px; height:465px;">
                                        <p:ajaxStatus style="width:16px;height:16px;">
                                            <f:facet name="start">
                                                <h:graphicImage value="25(2).gif" />
                                            </f:facet>
                                            <f:facet name="complete">
                                                <h:outputText value="" />
                                            </f:facet>
                                        </p:ajaxStatus>

                                        <h:panelGrid style=" height: 70px" columns="4">
                                            <h:outputText value="Email "/>
                                            <h:outputText value=":"/>
                                            <h:selectOneMenu id="email" required="true" requiredMessage="Please Select One Inactive Email" value="#{mailbean.email}">
                                                <f:selectItem itemLabel="Select Inactive Email" itemValue=""/>
                                                <f:selectItems value="#{UserManagedBean.userList}" var="user"
                                                               itemLabel ="#{user.email}" itemValue="#{user.email}"/> 
                                            </h:selectOneMenu>
                                            <p:message for="email"/>
                                        </h:panelGrid> 
                                        <p:commandButton onclick="alert('Please wait while we are sending the message')" value="Send Account Activation Email" ajax="false" update="panel" actionListener="#{mailbean.mailActivation}" /><br/>
                                    </p:panel>
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div id="footer">
                        <h:graphicImage url="/image/merlionfooter.jpg"/> 
                    </div>
                </h:form>
            </h:body>
        </f:view>
    </f:view>
</html>
